<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var a = 1;
        function innerA(){
            var a = 2;
            alert(a);
        }
        a = 3;
        innerA();
        alert(a);
    </script>
</head>
<body>

</body>
</html>